Repository navigation
Conversation
…trics Resonance frequency and quality factor from the -3 dB bandwidth of the magnitude response and from the decay of the envelope (Q = pi f0 tau), -3 dB cutoff frequencies, passband ripple, and the rise time, overshoot and settling time of a step response. Tests use systems with exact values: second-order resonators of known Q for both definitions, a Butterworth band-pass and a Chebyshev low-pass, a first-order step (rise tau ln 9, settling tau ln 50) and second-order steps (overshoot exp(-pi zeta / sqrt(1 - zeta^2))). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
response.bifurcation takes recordings along a sweep of a control parameter, up and then down, measures the amplitude of the oscillation in each (spectral peak near a given frequency, or rms), and returns the onset going up, the extinction going down and the hysteresis between them. The test uses a synthetic subcritical sweep with known thresholds. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ytta.response Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Nov 1, 2026
aguirreSL
added a commit
to aguirreSL/PyTTa
that referenced
this pull request
Nov 1, 2026
…by hand Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds to
pytta.responsethe three measures of #33 that #74 does not cover:envelope_slope(signalObj, top=-5, bottom=-35): the slope, in dB per second, of the Hilbert envelope of a decaying transient, fitted betweentopandbottomdB below its maximum.q_from_decaynow uses it, with the same result.inharmonicity(signalObj, f0, numPartials=10): the inharmonicity coefficient B of the stiff string model f_n = n f0 √(1 + B n²) (Fletcher, "Normal vibration frequencies of a stiff piano string", J. Acoust. Soc. Am. 36, 203, 1964). Each partial is the interpolated spectral peak within f0 / 4 of where the partials found so far predict it, and f0 and B are fitted by least squares on f_n² / n² = f0² + f0² B n². It also returns the partials and their deviation from n f0 in cents.plot_phase_plane(signalObj, quantity='position'): position against velocity, velocity against acceleration and acceleration against position, the other two quantities derived from the given one in the frequency domain.This pull request builds on #74 and shows its commits until #74 is merged.
The tests, added to
tests/test_response.py, print the measured values:Checked with Python 3.12, numpy 1.26 and scipy 1.17. The 7 failures of
development(3 intest_h5io.py, 4 intest_pyttasave.py) are the same with and without this change.Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com